<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>分店批发订单明细</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../res/layui-v2.5.6/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <script src="../../../res/js/jquery-3.4.1.min.js"></script>

</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>分店批发订单明细</legend>
</fieldset>
<form class="layui-form" action="" method="post" lay-filter="myform" id="myform">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">药品名：</label>
            <div class="layui-input-inline">
                <input type="text" name="drugName" id="drugName" placeholder="请输入药品名：" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <div class="layui-input-inline">
                <button type="button" class="layui-btn" lay-submit="" onclick="query()">搜索</button>
            </div>
        </div>

    </div>
</form>

<table class="layui-hide" id="test" lay-filter="test"></table>

<script src="../../../res/layui-v2.5.6/layui.js" charset="utf-8"></script>
<script src="../../../res/js/util.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

<script>
    var table = null;
    var perUser = null;

    layui.use(['table','layer'], function(){
        table = layui.table;
        var $ = layui.$;
        var layer = layui.layer;

        table.render({
            elem: '#test'
            ,url: '../../../sellDetail/shows'
            ,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }]
            ,title: '用户数据表'
            ,cols: [[
                // {type: 'checkbox', fixed: 'left'}
                // ,{field:'detailId', title:'销售明细id', width:100, fixed: 'left', unresize: true, sort: true}
                // ,{field:'sellId', title:'流水号', width:100},
                {field:'drugName', title:'药品名称', width:120}
                ,{field:'detailCount', title:'数量', width:120}
                ,{field:'drugWho', title:'批发价', width:80}
                ,{field:'price', title:'价格', width:80}
                ,{field:'optime', title:'明细时间', width:180}
            ]]
            ,page: true
            ,id:'testReload'
            ,where:{
                sellId:getQueryString("sellId")
            }
        });

    });

    function query() {
        table.reload('testReload',{
            where:{
                drugName:$("#drugName").val()
            },
            page:{
                curr:1
            }
        })
    }

</script>

</body>
</html>